﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace pygs.Locator
{
    public abstract class LocatorStatus
    {
        public static LocatorStatus Stoped = new LocatorStatusStoped();
        public static LocatorStatus Started = new LocatorStatusStarted();
        public static LocatorStatus Connected = new LocatorStatusConnected();

        public abstract bool IsStarted();
        public abstract bool IsConnected();
        public virtual string TextStatus()
        {
            return string.Format("started: {0}; connected: {1}", IsStarted(), IsConnected());
        }

        public override string ToString()
        {
            return base.ToString() + "; " + TextStatus();
        }
    }

    public class LocatorStatusStoped : LocatorStatus
    {
        public override bool IsStarted()
        {
            return false;
        }

        public override bool IsConnected()
        {
            return false;
        }
    }

    public class LocatorStatusStarted : LocatorStatus
    {
        public override bool IsStarted()
        {
            return true;
        }

        public override bool IsConnected()
        {
            return false;
        }
    }

    public class LocatorStatusConnected : LocatorStatus
    {
        public override bool IsStarted()
        {
            return true;
        }

        public override bool IsConnected()
        {
            return true;
        }
    }
}
